package cn.net.shuxing.yifu.common.service;

import cn.net.shuxing.yifu.common.bean.ContentAn;
import cn.net.shuxing.yifu.common.bean.ContentSys;
import cn.net.shuxing.yifu.common.mapper.ContentAnMapper;
import cn.net.shuxing.yifu.common.util.CommonExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ContentAnService extends BaseService<ContentAn,ContentAnMapper>{

    @Autowired
    private OssCommonService ossCommonService;

    public void addSkimNum(ContentAn contentAn)
    {
        if (contentAn == null)
            return;
        Integer anSkimNum = contentAn.getAnSkimNum();
        anSkimNum++;
        contentAn.setAnSkimNum(anSkimNum);
        this.update(contentAn);
    }



    public ContentAn getByInlienLink(String link) {
        CommonExample example = new CommonExample(ContentSys.class);
        example.equals("anLink",link);
        return getByExampleWithoutComplete(example);
    }
}
